ButtonPLUS2 Applet
Written by Eric C. Harshbarger
while at the New Media Marketing lab at Sun Microsystems, Inc.
[CAFÉ]-[CREATORS]-[APPLETS]-[FAQ]-[RESOURCES]-[RULES]-[DOWNLOADING]
Revisions since the initial PLUS version include the VTEXTALIGN parameter and support of the ONETAG parameter.
The ButtonPLUS2 applet is a java program which can be used to create dynamic buttons within a webpage. A variety of parameters allow the user a myriad of possibilities.
The param tags are the lines which customize the applet to your needs. Following is a list of all the parameter options which are currently available. Note that the 'name=' of the parameter as typed into the HTML document SHOULD BE CAPITALIZED... it is not necessary to capitalize the 'value' attributes. Defaults (where described) indicate what appropriate values will be used if not explicitly given in the HTML document.
parameters
- FONT
- FONTSIZE
- URL
- TEXT
- IMAGE
- SOUND
- BGCOLOR
- TEXTCOLOR
- HIGHLIGHT
- TEXTALIGN
- VTEXTALIGN
- name=FONT value=??
This value indicates the font type in which any messages on the buttons will be written. The default is Courier.
- name=FONTSIZE value=#
The size of the font. The default is 12.
- name=URL value=??
This is the destination URL which is actived when the button is clicked. The value should be a typical web address without the 'http://' prefix. The default URL is this explanation page.
- name=TEXT value=??|??|??
This value is consists of three 'messages' separated by the '|' symbol. The first message will appear when the mouse pointer is not interacting with the button. The second message appears when the pointer enters the applet (not clicking), and the third message appears when the button is clicked. Not that if you use this parameter, you must put two | symbols as delimiters even if there is not a message for that instance. For example, if you want a first message, no second message, and a third message, the value would look something like value=message1||message3. The default is that no messages will appear.
- name=IMAGE value=??|??|??
This value is consists of three paths to images separated by the '|' symbol. The first image will appear when the mouse pointer is not interacting with the button. The second image appears when the pointer enters the applet (not clicking), and the third image appears when the button is clicked. Not that if you use this parameter, you must put two | symbols as delimiters even if there is not an image for that instance. For example, if you want a first image, no second image, and a third image, the value would look something like value=image1||image3. The image names should include any relative path infomation from the directory in which the HTML document and class reside. TEXT (if given) will be superimposed over the appropriate image. Either gif or jpg format may be used. The default is that no images will appear.
- name=SOUND value=??|??
This value is consists of two paths to sounds separated by the '|' symbol. The first sound will play when the pointer enters the applet (not clicking), and the second sound plays when the button is clicked. Not that if you use this parameter, you must put a | symbol as a delimiter even if there is not a sound for that instance. For example, if you want a first sound, but no second sound, the value would look something like value=sound2|. The sound names should include any relative path infomation from the directory in which the HTML document and class reside. The default is that no sounds will play.
- name=BGCOLOR value=#,#,#
The value should be three numbers between 0 and 255 inclusively. They comprise an RGB value used to fill the button (assuming no images are drawn into the button). If the value is set to 'random', the applet will pick a color. The default is 192,192,192 (light gray).
- name=TEXTCOLOR value=#,#,#
The value should be three numbers between 0 and 255 inclusively. They comprise an RGB value used when writing any text which will appear. The default is 255,255,255 (white).
- name=HIGHLIGHT value=#
This parameter (if greater that 0) creates a 'relief' effect based on the BGCOLOR used. The button will appear to protrude from the page when left alone, will lighten slightly when 'entered', and appear to be depressed when 'clicked'. The numerical value of the parameter indicates how much relief should be used (as in pixel-width of the highlights). The default is 0 -- i.e.: no highlighting is used.
- name=TEXTALIGN value=center, left, or right
This parameter indicates whether any text messages should be justified right, left, or center in the button. The default is center.
- name=VTEXTALIGN value=center, top, or bottom
This parameter indicates whether any text messages should be vertical aligned top, bottom, or center in the button. The default is center.
-- Comments and suggestions are welcome: harshec@cdware.eng.sun.com, address Eric Harshbarger
[CAFÉ]-[CREATORS]-[APPLETS]-[FAQ]-[RESOURCES]-[RULES]-[DOWNLOADING]
The ButtonPLUS2 applet may be used freely by anyone. Neither Sun Microsystems, Inc. nor Eric C. Harshbarger is responsible for any problems resulting from the malfunction or misuse of this applet.
© Copyright 1996, Sun Microsystems, Inc.